﻿using Autofac; 

namespace Service.install
{
    public class AutofacModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        { 
            // It was then registered with Autofac using the Populate method in ConfigureServices.
            builder.RegisterAssemblyTypes(this.ThisAssembly)
                .Where(t => t.Name.EndsWith("Service"))
                .AsImplementedInterfaces()
                .InstancePerLifetimeScope();
        }
    }
}
